using System.ComponentModel.DataAnnotations;
using FytSoa.Common.Enum;
using FytSoa.Domain.Crm;
using FytSoa.Domain.Hr;
using FytSoa.Domain.Sys;
using SqlSugar;

namespace FytSoa.Domain.Erp;

/// <summary>
/// erp-报销信息
/// </summary>
[SugarTable("erp_finance_reimbursement")]
public class ErpFinanceReimbursement:Entity
{
    /// <summary>
    /// 编号
    /// </summary>
    [Required]
    [StringLength(50)]
    public string Number { get; set; }

    /// <summary>
    /// 报销类型
    /// </summary>
    [Required]
    public long TypeId { get; set; } = 0;
    
    /// <summary>
    /// 报销类型
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(TypeId))]
    public SysCode TypeObj { get; set; } 

    /// <summary>
    /// 报销申请人
    /// </summary>
    [Required]
    public long EmployeeId { get; set; }
    
    /// <summary>
    /// 报销申请人
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(EmployeeId))]
    public HrEmployee Employee { get; set; }

    /// <summary>
    /// 报销金额
    /// </summary>
    [Required]
    public decimal Amount { get; set; }

    /// <summary>
    /// 付款方式
    /// </summary>
    [Required]
    public long ModeId { get; set; }
    
    /// <summary>
    /// 付款方式
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ModeId))]
    public SysCode ModeObj { get; set; } 

    /// <summary>
    /// 付款时间
    /// </summary>
    [Required]
    public DateTime PayTime { get; set; } = DateTime.Now;
    
    /// <summary>
    /// 附件
    /// </summary>
    [SugarColumn(IsJson = true)]
    public List<FileBase> Files { get; set; } = new();

    /// <summary>
    /// 备注说明
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 审核状态
    /// </summary>
    [Required]
    public ErpAuditEnum Status { get; set; } = 0;

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}